<template>
  
  <div class="vita-list" :class="{'swiper-slide': supportSwipe}">
    
    <div class="scroller-wrapper" v-el:scroller>
      <div class="scroller">
        <slot>List-View-Cell Elements</slot>
      </div>
    </div>
  </div>

</template>

<script>

  import IScroll from 'iscroll'
  
  export default {

    name: 'vita-list',

    props: ['canSwipe', 'showDelete'],

    data() {
      return {
        iScroll: null,
        supportSwipe: false
      }
    },

    compiled() {
      let parent = this.$parent
      parent.registerSubContent(this)
      if (parent.enableSwiper) {
        this.supportSwipe = true
      }
    },

    methods: {
      duration(speed) {
        this.iScroll.options.deceleration = speed
      }
    },


    ready() {
      this.$nextTick(() => {
        this.iScroll = new IScroll(this.$els.scroller, {})
      })
    }

  }

</script>

<style lang="sass">
  
</style>